import os
__author__="jonathan"
__date__ ="$24-May-2010 20:54:11$"

import ConfigParser
from os.path import join, exists

# @type config ConfigParser
config = ConfigParser.ConfigParser({
    'IMAGE_DIR': 'images',
    'ARROW_DIR': 'arrow',
})

config_dir = join(os.getcwd(), 'config')
config_file = join(config_dir, 'game.cfg')

if exists(config_file):
    with open(config_file) as f:
        config.read(f)

config.get_option = lambda option : config.get(
        ConfigParser.DEFAULTSECT,
        option)

def save():
    with open(config_file, 'w') as f:
        config.write(f)

config.save = lambda : save()
